import { createApp } from 'vue'
import App from './App.vue'
// 公共样式  global css
import '@/assets/styles/index.scss' // global css
import store from './store'
import routers from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
//请求拦截
import './permission' // permission control
//字典
import { useDict } from '@/utils/dict'
import { selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
// import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
// 字典标签组件
import DictTag from '@/components/DictTag'
//下拉加载
// import infiniteScroll from 'vue3-infinite-scroll-better'
//评论组件库
import UndrawUi from 'undraw-ui'
import 'undraw-ui/dist/style.css'
// 富文本组件
import Editor from "@/components/Editor"

// 注册指令
import plugins from './plugins' // plugins
import { download } from '@/utils/request'


const app = createApp(App);

// 全局方法挂载
app.config.globalProperties.useDict = useDict
app.config.globalProperties.selectDictLabel = selectDictLabel
app.config.globalProperties.selectDictLabels = selectDictLabels

// 全局组件挂载
app.component('Editor', Editor);
app.component('DictTag', DictTag)
app.use(store);
app.use(routers);
app.use(ElementPlus);
app.use(UndrawUi);
app.use(plugins);
// app.use(infiniteScroll);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.mount('#app');